package cn.com.api.mapper.base;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.*;

import cn.com.api.entity.U_article;

//DAO
public interface U_articleMapperBase {

	// 根据id查看
	@Select("SELECT * FROM u_article  WHERE id = #{id}")
	public U_article findU_articleById(Integer id);

	// 查看数据集
	@Select("SELECT * FROM U_ARTICLE")
	public List<U_article> findU_articles();

	// 添加
	@Insert("INSERT INTO u_article (cate_id, title, content, author, atuthor_email, sort, keywords, article_type, is_visiable, add_time, read_count, description, header_img, img1, img2, img3, label, creater_id, modified_by, modified_time, share_count, apl_up ,apl_down,status,reject_reason,ext1, ext2, ext3, ext4, ext5, org_id, city) "
			+ "VALUES (#{cate_id}, #{title}, #{content}, #{author}, #{atuthor_email}, #{sort}, #{keywords}, #{article_type}, #{is_visiable}, #{add_time}, #{read_count}, #{description}, #{header_img}, #{img1}, #{img2}, #{img3}, #{label}, #{creater_id}, #{modified_by}, #{modified_time}, #{share_count}, #{apl_up}, #{apl_down}, #{status}, #{reject_reason}, "
			+ " #{ext1}, #{ext2}, #{ext3}, #{ext4}, #{ext5}, #{org_id}, #{city})")
	@Options(useGeneratedKeys = true, keyProperty = "id")
	public int insertU_article(U_article u_article);

	// 修改
	@Update("UPDATE u_article SET cate_id = #{cate_id}, title = #{title}, content = #{content}, author = #{author}, atuthor_email = #{atuthor_email}, sort = #{sort}, keywords = #{keywords}, article_type = #{article_type}, is_visiable = #{is_visiable}, add_time = #{add_time}, read_count = #{read_count}, description = #{description}, header_img = #{header_img}, img1 = #{img1}, img2 = #{img2}, img3 = #{img3}, label = #{label}, creater_id = #{creater_id}, modified_by = #{modified_by}, modified_time = #{modified_time}, share_count = #{share_count}, apl_up = #{apl_up}, apl_down = #{apl_down}, org_id = #{org_id},city = #{city},status= #{status},reject_reason = #{reject_reason}, ext1 = #{ext1}, ext2 = #{ext2}, ext3 = #{ext3}, ext4 = #{ext4}, ext5 = #{ext5} WHERE id = #{id}")
	public int updateU_article(U_article u_article);

	// 删除
	@Delete("DELETE FROM u_article  WHERE id = #{id}")
	public int deleteU_article(Integer id);

	// Foreign keys revelant

	// region Indexs revelant

}
